Skip to content

Issue #51022: Improve E0131 message when lifetimes are involved. #51084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2018

Conversation

simartin
Copy link
Contributor

Fixes #51022

@rust-highfive
Copy link
Contributor

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 26, 2018
@rust-highfive

This comment has been minimized.

// except according to those terms.

// error-pattern: `main` function is not allowed to have lifetime parameters
fn main<'a>() { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using error-pattern you can add below a line with

//~^ ERROR `main` function is not allowed to have lifetime parameters

instead.

Also, I'd prefer new tests to be ui instead of just compile-fail. That way we also test the visual output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Will do this is in a follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up PR at #51108

"lifetime"
} else {
"type"
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intrigued as to what the output is when you have fn main<'a, T>() {}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would say lifetime, because one of the parameters is a lifetime. Would you go "lifetime nor type" parameters in such a case?

@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 27, 2018

📌 Commit 023137d has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2018
@bors
Copy link
Collaborator

bors commented May 27, 2018

⌛ Testing commit 023137d with merge d005ea2...

bors added a commit that referenced this pull request May 27, 2018
Issue #51022: Improve E0131 message when lifetimes are involved.

Fixes #51022
@bors
Copy link
Collaborator

bors commented May 27, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 27, 2018
@rust-highfive

This comment has been minimized.

@kennytm
Copy link
Member

kennytm commented May 27, 2018

@bors retry #40474

[01:04:52] fatal: unable to access 'https://github.com/rust-lang-nursery/rust-toolstate.git/': Could not resolve host: github.com

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2018
@rust-lang rust-lang deleted a comment from rust-highfive May 27, 2018
@bors
Copy link
Collaborator

bors commented May 27, 2018

⌛ Testing commit 023137d with merge 7d218fc...

bors added a commit that referenced this pull request May 27, 2018
Issue #51022: Improve E0131 message when lifetimes are involved.

Fixes #51022
@bors
Copy link
Collaborator

bors commented May 27, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing 7d218fc to master...

@bors bors merged commit 023137d into rust-lang:master May 27, 2018
@simartin simartin deleted the issue_51022 branch May 27, 2018 12:35
simartin added a commit to simartin/rust that referenced this pull request May 27, 2018
bors added a commit that referenced this pull request May 27, 2018
Address comments in pull request #51084.

This is a follow-up to #51084, that's already been integrated into mainline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants